<template>
	<view class="article-wrap">
		<view class="article-tab">
			<view class="article-tab-outer" @click="gotoRouter('/pages-doctor/editArticle/editArticle')">
				<image src="http://k8s.vendingtech.vip/images/edit_article@2x.png" class="article-tab-pic"></image>
				<view>发布文章</view>
			</view>
			<view class="article-tab-outer" @click="gotoRouter('/pages-doctor/myArticle/myArticle?status=0')">
				<image src="http://k8s.vendingtech.vip/images/draft@2x.png" class="article-tab-pic"></image>
				<view>我的草稿</view>
			</view>
			<view class="article-tab-outer" @click="gotoRouter('/pages-doctor/myArticle/myArticle?status=1')">
				<image src="http://k8s.vendingtech.vip/images/my_article@2x.png" class="article-tab-pic"></image>
				<view>我的文章</view>
			</view>
		</view>

		<view class="index-article" v-if="articleList.length > 0">
			<u-title value="案例展示"></u-title>
			<view class="index-article-scroll ">
				<u-article-item v-for="(item, index) in articleList" :key="index" :data="item"></u-article-item>
			</view>
		</view>
		
		
	</view>
</template>

<script>
import uArticleItem from '@/components/u-article-item/u-article-item.vue';
import uTitle from '@/components/u-title/u-title.vue';
export default {
	components: {
		uArticleItem,
		uTitle
	},
	data() {
		return {
			articleList: []
		};
	},
	onLoad(option) {
		this.queryArticleList();
	},
	onShow() {},
	methods: {
		//文章列表
		queryArticleList() {
			this.$api
				.queryArticleList({
					params: {
						isReferrer: 1,
						pageSize: 5
					}
				})
				.then(res => {
					if (res.code == 200) {
						this.articleList = res.result.records;
					} else {
						uni.showToast({
							title: res.message,
							icon: 'none'
						});
					}
				});
		}
	}
};
</script>

<style lang="less">
@import './article.less';
</style>
